Many computer systems have multiple processors arranged to execute instructions. Each processor is arranged to receive a clock signal, and to set its operating frequency in dependence thereon. In other words, the frequency of processing cycles within the processor is set in dependence on the frequency of the clock signal. Commonly, the operating frequency of the processor equals the frequency of the clock signal. The operating frequency determines how quickly that processor processes an instruction. The higher the frequency of the clock signal input to the processor, the faster the instructions will be executed by the processor in real-time.
Processing cycles can be spent on both useful work such as, for example, instruction execution, intentional idle, and on non-useful work such as, for example, when a hazard is introduced into the pipeline or when waiting for memory accesses to complete. An intentional idle may be introduced to avoid a hazard being introduced into the pipeline. A hazard may be a structural hazard (such as when the hardware cannot support a combination of instructions that are to be executed in parallel), a data hazard (such as when an instruction depends on the results of an instruction still in the processor pipeline) and a control hazard (such as when a decision needs to be made based on the result of an instruction while other instructions are executing). One example of a hazard is when the instruction pipeline needs to be flushed following a branch misprediction.
The time taken for useful work to be completed can be calculated using instructions per second (IPS) and subsequently converted into a clock frequency that the processor can request to operate at. IPS may be obtained using a software-based request. To account for the fact that non-useful work is also likely to be performed, the IPS value is converted into a clock frequency request value using a “worst-case” conversion factor. The clock frequency request value is provided to a control system in the computer system for setting the frequency of the clock signal.